package com.bmadmin.service.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.bmadmin.domain.LayUiDataTablePOJO;
import com.bmadmin.domain.SxxlDomain;
import com.bmadmin.domain.ZcwhDomain;
import com.bmadmin.mapper.ZcflwhDao;
import com.bmadmin.mapper.ZcwhDao;
import com.bmadmin.service.ZcwhService;
@Service
@Transactional
public class ZcwhServiceImpl implements ZcwhService {
	@Autowired
	ZcwhDao zcwhDao;
	
	public List<ZcwhDomain> getZcList(Map map){
		return zcwhDao.getZcList(map);
	}
	
	public int insertZcwh(ZcwhDomain zcwh){
		return zcwhDao.insertZcwh(zcwh);
	}
	
	public int deleteZc(String zc_id){
		return zcwhDao.deleteZc(zc_id);
	}
	
	public int updateZcwh(ZcwhDomain zcwh){
		return zcwhDao.updateZcwh(zcwh);
	}
	
	public LayUiDataTablePOJO getZcSel(String zcfl_dm){
		LayUiDataTablePOJO result = new LayUiDataTablePOJO();
		Map map = new HashMap();
		map.put("zcfl_dm", zcfl_dm);
        List<ZcwhDomain> list = zcwhDao.getZcList(map);
        result.setCode(0);
        result.setMsg("查询成功");
        result.setData(list);
        result.setCount(list.size());

        return result;
	}
}
